# -*- coding: utf-8 -*-
# @Time : 2018/12/24 19:27
# @Author : Administrator
# @File : utility.py
# @Project : 4.Python
# @title : utility
class Utility():
    def csv_read_login(self):
        with open('loginData.csv') as file:
            datas=file.readlines()
            # print(datas)
            # print(len(datas))
            # print(datas[0].split(',')[0])
            key1 = datas[0].strip().split(',')[0]
            key2 = datas[0].strip().split(',')[1]
            key3 = datas[0].strip().split(',')[2]
            key4 = datas[0].strip().split(',')[3]
            list=[]
        for i in range(1,len(datas)):
            # print(i)
            dict={}
            dict[key1] = datas[i].strip().split(',')[0]
            dict[key2] = datas[i].strip().split(',')[1]
            dict[key3] = datas[i].strip().split(',')[2]
            dict[key4] = datas[i].strip().split(',')[3]
            # print(dict)
            list.append(dict)
        # print(list)
        return list
    def csv_read_addMember(self):
        with open('addMemberData.csv') as file:
            datas=file.readlines()
            key1 = datas[0].strip().split(',')[0]
            key2 = datas[0].strip().split(',')[1]
            key3 = datas[0].strip().split(',')[2]
            key4 = datas[0].strip().split(',')[3]
            key5 = datas[0].strip().split(',')[4]
            key6 = datas[0].strip().split(',')[5]
            key7 = datas[0].strip().split(',')[6]
            list=[]
        for i in range(1,len(datas)):
            # print(i)
            dict={}
            dict[key1] = datas[i].strip().split(',')[0]
            dict[key2] = datas[i].strip().split(',')[1]
            dict[key3] = datas[i].strip().split(',')[2]
            dict[key4] = datas[i].strip().split(',')[3]
            dict[key5] = datas[i].strip().split(',')[4]
            dict[key6] = datas[i].strip().split(',')[5]
            dict[key7] = datas[i].strip().split(',')[6]
            list.append(dict)
        # print(list)
        return list
    def excel_read_api3Data(self):
        pass

if __name__ == '__main__':
    u=Utility()
    # u.csv_read_login()
    u.csv_read_addMember()